/*
 * Copyright (c) 2024 Black Sesame Technologies
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _DAL_LOCATOR_H_
#define _DAL_LOCATOR_H_

#include "base_type.h"

#ifdef __cplusplus
extern "C" {
#endif

#define DAL_LOCATOR_ADDR_LEN 16

typedef enum dal_locator_kind_e
{
    DAL_LOCATOR_INVALID = 0,
    DAL_LOCATOR_KIND_INVALID,
    DAL_LOCATOR_KIND_RESERVED,
    DAL_LOCATOR_KIND_UDPv4,
    DAL_LOCATOR_KIND_UDPv6,
    DAL_LOCATOR_KIND_TCPv4,
    DAL_LOCATOR_KIND_TCPv6,
    DAL_LOCATOR_KIND_SHM,
    DAL_LOCATOR_ADDRESS_INVALID,
    DAL_LOCATOR_PORT_INVALID,
} dal_locator_kind_t;

typedef struct dal_locator_s
{
    dal_locator_kind_t kind;
    octet address[DAL_LOCATOR_ADDR_LEN];
    uint32_t port;
} dal_locator_t;

typedef dal_locator_t dal_unicast_locator_t;

#ifdef __cplusplus
}
#endif

#endif  // _DAL_LOCATOR_H_